#include "widget.h"
#include "ui_widget.h"


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    _myButton = new QPushButton(this);
    _myButton->setText("Hello World");
    _myButton->move(200, 300);

    connect(_myButton, &QPushButton::clicked, this, &Widget::handClick);
}

void Widget::handClick()
{
    if(_myButton->text() == "Hello World")
        _myButton->setText("Hello Qt");
    else
        _myButton->setText("Hello World");
}

Widget::~Widget()
{
    delete ui;
}

